<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 有数组:["张三","张思","张武","王榴","王麒","李霸","李玖","刘仕"]
   用户输入:姓 打印该姓氏所有的名字,否则打印没有 -->
   <script>
    let arr=["张三","张思","张武","王榴","王麒","李霸","李玖","刘仕"]
    let code = prompt("请输入：姓");
    arr.forEach(function(v){
        if(code.value=="张"){
        console.log();
    }
    })
   </script>
</body>
</html>